﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestPrj
{
    public  class StringMaker
    {
        public void Execute()
        {
            List<string> lineA = new List<string>();
            List<string> lineB = new List<string>();
            using (StreamReader sr = new StreamReader("E:/file1.txt"))
            {
                while (!sr.EndOfStream)
                {
                    lineA.Add(sr.ReadLine());
                }
            }
            string[] arrayA = lineA.ToArray();


            using (StreamReader sr = new StreamReader("E:/file2.txt"))
            {
                while (!sr.EndOfStream)
                {
                    lineB.Add(sr.ReadLine());
                }
            }
            string[] arrayB = lineB.ToArray();

            using (StreamWriter sw = new StreamWriter("E:/fileout.txt"))
            {
                for(int i=0;i<arrayA.Length;i++)
                {
                    
                    sw.WriteLine($" update bw_alllifelog set meter_code = '{lineB[i]}' where meter_code = '{lineA[i]}';");
                }
                sw.Close();
            }
          


        }
    }
}
